"""
bubble 就是前面和后面的数据进行比较．
"""


def bubble(array):
    for i in range(len(array)):
        for j in range(len(array)-i-1):
            if array[j] < array[j+1]:
                array[j], array[j+1] = array[j+1], array[j]
    return array


def bubble1():
    pass


def bubble2():
    pass


if __name__ == '__main__':
    array = [1, 2, 3, 4, 6, 7, 9, 8, 6, 4, 9, 7, 8]
    print(bubble(array))